package com.arvato.wxwork.bean.bean_vo.store;

import java.util.Arrays;
import java.util.List;

import com.arvato.common.util.ContantFinalUtil;

/**
 * 表wxwork_area前台所需实体类
 * @author zhan655
 *
 */
public class WxworkAreaVo {
	/**
	 * 主键ID
	 */
    private String areaId;
    /**
     * 区域名称
     */
    private String areaName;
    /**
     * 区域编号
     */
    private String areaCode;
    /**
     * 下属省列表
     */
    private String provinceList;
    /**
     * 备注
     */
    private String note;
    /**
     * 排序码
     */
    private Integer sortCode;
    /**
     * 省列表
     */
    private List<String> provinceArray;
    /**
     * 文件名称
     */
    private String fileName;
    /**
     * 文件预览路径
     */
    @SuppressWarnings("unused")
	private String imgViewPath;
    
    public String getAreaId() {
        return areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId == null ? null : areaId.trim();
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName == null ? null : areaName.trim();
    }
    
	public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode == null ? null : areaCode.trim();
    }

    public String getProvinceList() {
    	return provinceList;
    }
    
    public void setProvinceList(String provinceList) {
    	this.provinceList = provinceList;
    }
    
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note == null ? null : note.trim();
    }

    public Integer getSortCode() {
        return sortCode;
    }

    public void setSortCode(Integer sortCode) {
        this.sortCode = sortCode;
    }

	public List<String> getProvinceArray() {
		if(provinceArray == null) {
			 String[] split = provinceList.split(",");
			 provinceArray = Arrays.asList(split);
		}
		return provinceArray;
	}

	public void setProvinceArray(List<String> provinceArray) {
		this.provinceArray = provinceArray;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getImgViewPath() {
		try {
			return ContantFinalUtil.IMG_PATH + "?fileName=" + fileName;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

	public void setImgViewPath(String imgViewPath) {
		this.imgViewPath = imgViewPath;
	}
	
}